package com.bmps.springcloud.insuredmicroservice.callback.accept;

import com.bmps.springcloud.common.response.TaskResponseModel;
import com.bmps.springcloud.insuredmicroservice.model.accept.resquest.ProductModel;
import com.bmps.springcloud.insuredmicroservice.model.accept.resquest.RequestModel;
import com.bmps.springcloud.insuredmicroservice.service.RedisService;
import com.bmps.springcloud.insuredmicroservice.service.underwrite.AcceptService;

import java.util.concurrent.Callable;

/**
 * description:
 *
 * @author jackdaw
 * @date 2020-06-28 15:51
 */
public class AddPremCallBack implements Callable<TaskResponseModel> {
    private final String key;
    private final ProductModel productModel;
    private final RequestModel requestModel;
    private final AcceptService acceptService;

    public AddPremCallBack(String key, ProductModel productModel, RequestModel requestModel, AcceptService acceptService) {
        this.key = key;
        this.productModel = productModel;
        this.requestModel = requestModel;
        this.acceptService = acceptService;
    }

    @Override
    public TaskResponseModel call() throws Exception {
        return acceptService.calculationAddPrem(key, productModel, requestModel);
    }
}
